纯 css 画三角形与 border 属性相关
width: 0;
height: 0;
border: 100px solid transparent;
border-bottom: 100px solid #3498db;
border-width: 0 100px 100px 100px;
width: 0;
height: 0;
border: 100px solid transparent;
border-top: 100px solid #e74c3c;
border-width: 100px 100px 0 100px;
width: 0;
height: 0;
border: 100px solid transparent;
border-right: 100px solid #2ecc71;
border-width: 100px 100px 100px 0;
width: 0;
height: 0;
border: 100px solid transparent;
border-left: 100px solid #f1c40f;
border-width: 100px 0 100px 100px;
width: 100px;
height: 100px;
border-top: 100px solid #e74c3c;
border-right: 100px solid #2ecc71;
border-bottom: 100px solid #3498db;
border-left: 100px solid #f1c40f;
width: 0;
height: 0;
border-top: 100px solid #e74c3c;
border-right: 100px solid #2ecc71;
border-bottom: 100px solid #3498db;
border-left: 100px solid #f1c40f;
width: 0;
height: 0;
border: 100px solid transparent;
border-top: 100px solid #e74c3c;
虽然当前显示为三角形,但实际占用的空间还是矩形
width: 0;
height: 0;
border: 100px solid transparent;
border-top: 100px solid #e74c3c;
border-width:100px 100px 0 100px;
可以看到三角形方向是与 border 属性 top bottom left right 方向相反的